﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;

namespace MyMusicCollection.Model
{
	class InternetStatusChecker
	{
		public static bool CheckStatus()
		{
			try
			{
				HttpWebRequest reqFP = (HttpWebRequest)HttpWebRequest.Create("Http://www.google.com");
				HttpWebResponse rspFP = (HttpWebResponse)reqFP.GetResponse();
				
				if (HttpStatusCode.OK == rspFP.StatusCode)
				{
					rspFP.Close();
					return true;
				}
				else
				{
					rspFP.Close();
					return false;
				}
			}
			catch (WebException)
			{
				return false;
			}
		}
	}
}
